package com.dt76.smallloanbackendservice.controller.jh;

import com.dt76.smallloanbackendservice.pojo.jh.DataTemplate;
import com.dt76.smallloanbackendservice.service.jh.UserinformationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.HashMap;
import java.util.List;
import java.util.Map;


@Controller
public class UserinformationController {

    private final UserinformationService userinformationService;

    @Autowired
    public UserinformationController(UserinformationService userinformationService) {
        this.userinformationService = userinformationService;
    }

    @RequestMapping("/jh/qryAll")
    @ResponseBody
    public Map<String, List<DataTemplate>> qryAll() {
        List<DataTemplate> list = userinformationService.qryAll();
        System.out.println(list);
        List<DataTemplate> list2 = userinformationService.qryConfirmIDAll();
        List<DataTemplate> list3 = userinformationService.qryNumberAll();
        List<DataTemplate> list4 = userinformationService.qryDataTemplateAll();
        Map<String, List<DataTemplate>> map = new HashMap<>();
        map.put("list",  list);
        map.put("list2", list2);
        map.put("list3", list3);
        map.put("list4", list4);
        return map;
    }
}
